package com.kma.summer2012.client.events.request;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.kma.summer2012.shared.model.UICrumbsRequest;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: EUGENE
 * Date: 2/19/13
 * Time: 11:24 PM
 * To change this template use File | Settings | File Templates.
 */
public class ExportRequestEvent extends GwtEvent<ExportRequestEvent.ExportRequestEventHandler> {
    public List<UICrumbsRequest> requests;

    public ExportRequestEvent(List<UICrumbsRequest> requests) {
        this.requests = requests;
    }

    private static Type<ExportRequestEventHandler> TYPE = new Type<ExportRequestEventHandler>();

    @Override
    public Type<ExportRequestEventHandler> getAssociatedType() {
        return TYPE;
    }

    public static Type<ExportRequestEventHandler> getType() {
        return TYPE;
    }

    @Override
    protected void dispatch(ExportRequestEventHandler importRequestEventHandler) {
        importRequestEventHandler.onExportRequest(this.requests);
    }

    public interface ExportRequestEventHandler extends EventHandler {
        void onExportRequest(List<UICrumbsRequest> requests);
    }
}
